// App.tsx
// 导入路由
import { Router, Route, Redirect } from 'react-router-dom'
// import history from '@/utils/history'
// 导入页面组件
import Login from '@/pages/Login/Login'
import Layout from '@/pages/Layout/Layout'
import ProfileEdit from './pages/Profile/Edit'
import { PrivateRoute } from '@/components/PrivateRoute'
import history from '@/utils/history'
import './App.scss'
import Chat from './pages/Profile/Chat/Chat'
// 配置路由规则
function App () {
  return (
    <Router history={history}>
      <div className="app">
        <Route path="/" exact render={() => <Redirect to="/home" />} />
        <Route path="/home">
          <Layout />
        </Route>
        <Route path="/login">
          <Login />
        </Route>
        <PrivateRoute path="/profile/edit">
          <ProfileEdit />
        </PrivateRoute>
        <PrivateRoute path="/chat">
          <Chat></Chat>
        </PrivateRoute>
      </div>
    </Router>
  )
}

export default App
